﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;

namespace ASPresentation
{
    /// <summary>
    /// App.xaml 的交互逻辑
    /// </summary>
    public partial class App : Application
    {

        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);


            //为了三维辅助系统能够正常工作
            this.ShutdownMode = ShutdownMode.OnMainWindowClose;





            //vista以及以后的版本
            if (System.Environment.OSVersion.Version.Major >= 6)
            {

            }
            else
            {
                //vista之前的版本



            }



            if (e.Args.Length > 0)
            {


            }


            ApplicationService.CurrentService.InitModules();

            this.DispatcherUnhandledException += new System.Windows.Threading.DispatcherUnhandledExceptionEventHandler(App_DispatcherUnhandledException);



        }

        void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
        {
            //throw new NotImplementedException();

            //尝试弹出更友好的界面提示，以及紧急情况下的数据保存


        }


        protected override void OnSessionEnding(SessionEndingCancelEventArgs e)
        {



            base.OnSessionEnding(e);
        }


    }
}
